package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.vo.PatientMedicalRecordRemoteVo;
import com.mk.admin.model.vo.PatientMedicalRecordVo;
import com.mk.admin.service.PatientMedicalRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/patientMedicalRecord")
@Api(tags = "门诊病历")
public class PatientMedicalRecordController extends BaseController<PatientMedicalRecordVo> {
    @Autowired
    private PatientMedicalRecordService patientMedicalRecordService;

    @PostMapping("/select")
    @Override
    public ResultDto select(@RequestBody PatientMedicalRecordVo patientMedicalRecordVo) {
        return patientMedicalRecordService.select(patientMedicalRecordVo);
    }


    @PostMapping("/report")
<<<<<<< HEAD
    @ApiOperation(value = "emr_1001患者病历详情刷新", notes = "查询患者病历详情（日期降序排序），如不传卡号信息则日期必传，查询所有患者的病历")
=======
    @ApiOperation(value = "com_0326患者病历详情刷新", notes = "查询患者病历详情（日期降序排序），如不传卡号信息则日期必传，查询所有患者的病历")
>>>>>>> f2106939b942a7ac2c3470910120a35364fbfaac
    public ResultDto report(@RequestBody PatientMedicalRecordRemoteVo patientMedicalRecordRemoteVo) {
        return patientMedicalRecordService.report(patientMedicalRecordRemoteVo);
    }

    @PostMapping("/remote")
    @ApiOperation(value = "患者病历详情刷新", notes = "查询患者病历详情（日期降序排序），如不传卡号信息则日期必传，查询所有患者的病历")
    public ResultDto remote(@RequestBody PatientMedicalRecordRemoteVo patientMedicalRecordRemoteVo) {
        return patientMedicalRecordService.remote(patientMedicalRecordRemoteVo);
    }

    @PostMapping("/add")
    @Override
    public ResultDto add(@RequestBody PatientMedicalRecordVo patientMedicalRecordVo) {
        return patientMedicalRecordService.add(patientMedicalRecordVo);
    }

    @PostMapping("/update")
    @Override
    public ResultDto update(@RequestBody PatientMedicalRecordVo patientMedicalRecordVo) {
        return patientMedicalRecordService.update(patientMedicalRecordVo);
    }

    @PostMapping("/delete")
    @Override
    public ResultDto delete(@RequestBody PatientMedicalRecordVo patientMedicalRecordVo) {
        return patientMedicalRecordService.delete(patientMedicalRecordVo.getId());
    }

    @PostMapping("/status")
    @Override
    public ResultDto status(@RequestBody PatientMedicalRecordVo patientMedicalRecordVo) {
        return patientMedicalRecordService.status(patientMedicalRecordVo.getId());
    }
}
